home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / MODEM.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-17  |  1KB  |  63 lines

  1. Unit Modem;
  2.  
  3. Interface
  4.  
  5. { Modem Interface for FOSSIL.PAS, Fossil Drivers }
  6. { Compatible with X.00 and BNU! -- TESTED with   }
  7. { Written by: The Elemental dude }
  8.  
  9. Uses Fossil, Configrt;
  10.  
  11. Procedure SetParam (ComPort:Integer; BaudRate:LongInt; Parity:Boolean);
  12. Procedure ClosePort;
  13. Function NumChars:Integer;
  14. Procedure DontAnswer;
  15. Procedure DoAnswer;
  16.  
  17.  
  18.  {* Variables will give the Address of the REAL Procedure }
  19.  {* Having these to call it is SLOWER! }
  20.  
  21. Var SendChar   : Procedure (K:Char);
  22.     GetChar    : Function:Char;
  23.     Carrier    : Function:Boolean;
  24.     Hangup     : Procedure;
  25.  
  26. Implementation
  27.  
  28. Procedure SetParam (ComPort:Integer; BaudRate:LongInt; Parity:Boolean);
  29. Var K:Char;
  30. Begin
  31.   Case Parity of
  32.    TRUE :K:='E';
  33.    FALSE:K:='N';
  34.   End;
  35.   Set_FOSSIL (ComPort,BaudRate,8,K,1);
  36. End;
  37.  
  38. Procedure ClosePort;
  39. Begin
  40.   Close_FOSSIL (Configset.UseCo);
  41. End;
  42.  
  43. Function NumChars:Integer;
  44. Begin
  45.   NumChars:=Ord(FOSSIL_Chars);
  46. End;
  47.  
  48. Procedure DontAnswer;
  49. Begin
  50.   FOSSIL_Dtr (ConfigSet.UseCo,False);
  51. End;
  52.  
  53. Procedure DoAnswer;
  54. Begin
  55.   FOSSIL_Dtr (ConfigSet.UseCo,True);
  56. End;
  57.  
  58. Begin
  59.   SendChar:=FOSSIL.SendChar;
  60.   GetChar:=FOSSIL.GetChar;
  61.   Carrier:=FOSSIL.FOSSIL_Carrier;
  62.   Hangup:=FOSSIL.Hangup;
  63. End.